home *** CD-ROM | disk | FTP | other *** search
- /* getfat.c --- p. 608 */
- #include <stdio.h>
- #include <dos.h>
- main()
- {
- struct fatinfo fat;
- unsigned char fatid;
- long capacity;
- /* Get information from the FAT of current drive */
- getfat(0, &fat);
- printf("FAT of drive %c\n", getdisk()+'A');
- fatid = fat.fi_fatid;
- printf("Sectors per cluster %d\n"
- "FAT ID %X\n"
- "Number of clusters %d\n"
- "Bytes per sector: %d\n",
- fat.fi_sclus, fatid,
- fat.fi_nclus, fat.fi_bysec);
- capacity = (long)fat.fi_sclus *
- (long)fat.fi_nclus *
- (long)fat.fi_bysec;
- printf("TOTAL CAPACITY: %ld bytes\n", capacity);
- }
-